/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

/**
 *
 * @author Marco
 */

@Entity
@NamedQueries({
    @NamedQuery(name = "Posto.findBySettore", query = "SELECT p.id FROM Posto p WHERE p.settore= :settore ORDER BY p.fila,p.numero"),
    @NamedQuery(name = "Posto.findPosto", query = "SELECT p FROM Posto p WHERE p.settore= :settore AND p.fila =:fila AND p.numero =:numero")
})
public class Posto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String fila;
    private int numero;
    private String settore;
    private boolean disabili;

    /**
     * Get the value of disabili
     *
     * @return the value of disabili
     */
    public boolean isDisabili() {
        return disabili;
    }

    /**
     * Set the value of disabili
     *
     * @param disabili new value of disabili
     */
    public void setDisabili(boolean disabili) {
        this.disabili = disabili;
    }


    /**
     * Get the value of settore
     *
     * @return the value of settore
     */
    public String getSettore() {
        return settore;
    }

    /**
     * Set the value of settore
     *
     * @param settore new value of settore
     */
    public void setSettore(String settore) {
        this.settore = settore;
    }

    

    /**
     * Get the value of numero
     *
     * @return the value of numero
     */
    public int getNumero() {
        return numero;
    }

    /**
     * Set the value of numero
     *
     * @param numero new value of numero
     */
    public void setNumero(int numero) {
        this.numero = numero;
    }


    /**
     * Get the value of fila
     *
     * @return the value of fila
     */
    public String getFila() {
        return fila;
    }

    /**
     * Set the value of fila
     *
     * @param fila new value of fila
     */
    public void setFila(String fila) {
        this.fila = fila;
    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Posto)) {
            return false;
        }
        Posto other = (Posto) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Posto[ id=" + id + " ]";
    }
    
}
